import numpy as np
from sklearn.datasets import load_wine


def alcohol_mean(data):
    '''
    返回红酒数据中红酒的酒精平均含量
    :param data: 红酒数据对象
    :return: 酒精平均含量，类型为float
    '''

    return data["data"][:, 0].mean()


wine_dataset = load_wine()

result = alcohol_mean(wine_dataset)

if abs(result - 13.00061797752809) < 0.01:
    print('平均酒精含量计算正确')
else:
    print('你的计算结果为:%.6f，与答案不一致，请继续努力' % result)
